//
//  PKRegisterViewController.m
//  pantaKills
//
//  Created by 湛凯杰 on 16/8/3.
//  Copyright © 2016年 湛凯杰. All rights reserved.
//

#import "PKRegisterViewController.h"
#import "PKwelcomeViewController.h"
@interface PKRegisterViewController ()
@property(nonatomic,strong)UILabel* labelOfTitle;
@property(nonatomic,strong)UIImageView * imageViewOfAnimation;
@property(nonatomic,strong)UIImageView* imageViewOfTag;
@property(nonatomic,strong)UILabel * labelOfHeard;
@end

@implementation PKRegisterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=MAIN_BACKCOLOR;
    [self addView];


}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark - 布局
-(void)addView{
    [self.view addSubview:self.labelOfTitle];
    [self.view addSubview:self.labelOfHeard];
    [self.view addSubview:self.imageViewOfAnimation];
    [self.view addSubview:self.imageViewOfTag];
    
    [self.labelOfHeard mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view.mas_top).offset(50);
        make.width.mas_equalTo(50);
        make.trailing.leading.equalTo(self.view);
    }];
    [self.labelOfTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.labelOfHeard.mas_bottom).offset(30);
        make.leading.equalTo(self.view.mas_leading).offset(40);
        make.trailing.equalTo(self.view.mas_trailing).offset(-40);
        make.bottom.equalTo(self.view.mas_bottom).offset(-240);
    }];
    [self.imageViewOfTag mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.labelOfTitle.mas_bottom).offset(40);
        make.width.mas_equalTo(135);
        make.height.mas_equalTo(60);
        make.leading.equalTo(self.view.mas_trailing).offset(-150);
        
    }];
    [self.imageViewOfAnimation mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view.mas_bottom).offset(-30);
        make.width.mas_equalTo(200);
        make.height.mas_equalTo(110);
        make.leading.equalTo(self.view.mas_leading).offset(40);
    }];
    
    
    
    
}

#pragma mark - 懒加载
-(UILabel *)labelOfTitle{
    if (!_labelOfTitle) {
        _labelOfTitle=[[UILabel alloc]init];
        _labelOfTitle.numberOfLines=0;
        _labelOfTitle.backgroundColor=[UIColor clearColor];
        [_labelOfTitle setTextColor:[UIColor whiteColor]];
        _labelOfTitle.text=@"       花半开最美,情留白最浓,懂得给生命留白，亦是一种生活的智慧,所以没有注册的。不要问我为什嚒,问了也是白问,宁静致远,懂得给心灵留白的，方能在纷杂繁琐的时机饿,淡看得失,宠辱不惊,去意无留，所以无法注册，人生平淡更持久,方能深远,有些东西空缺才是美,所以不能注册,蹦下卡拉卡，蹦下卡拉卡，蹦下卡拉卡！！";
        _labelOfTitle.font=[UIFont systemFontOfSize:20.0f];
        
    }return _labelOfTitle;
}
-(UIImageView *)imageViewOfAnimation{
    if (!_imageViewOfAnimation) {
        _imageViewOfAnimation=[[UIImageView alloc]init];
        NSMutableArray* arrayOfimage=[NSMutableArray array];
        [arrayOfimage addObject:[UIImage imageNamed:@"login_1"]];
        [arrayOfimage addObject:[UIImage imageNamed:@"login_2"]];
        [arrayOfimage addObject:[UIImage imageNamed:@"login_3"]];
        [arrayOfimage addObject:[UIImage imageNamed:@"login_4"]];
        [arrayOfimage addObject:[UIImage imageNamed:@"login_5"]];
        [arrayOfimage addObject:[UIImage imageNamed:@"login_6"]];
        _imageViewOfAnimation.animationImages=arrayOfimage;
        _imageViewOfAnimation.animationDuration=1;
        [_imageViewOfAnimation startAnimating];
    }return _imageViewOfAnimation;
}
-(UIImageView *)imageViewOfTag{
    if (!_imageViewOfTag) {
        _imageViewOfTag=[[UIImageView alloc]init];
        _imageViewOfTag.image=[UIImage imageNamed:@"kaijie"];
    }return _imageViewOfTag;
}
-(UILabel *)labelOfHeard{
    if (!_labelOfHeard) {
        _labelOfHeard=[[UILabel alloc]init];
        _labelOfHeard.text=@"冒得注册的！！";
        [_labelOfHeard setTextColor:[UIColor whiteColor]];
        [_labelOfHeard setBackgroundColor:[UIColor clearColor]];
        _labelOfHeard.font=[UIFont systemFontOfSize:25.0f];
        _labelOfHeard.textAlignment=NSTextAlignmentCenter;
    }return _labelOfHeard;
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
//    [self presentViewController:[PKwelcomeViewController new] animated:YES completion:^{
//    }];

    [self addChildViewController:[PKwelcomeViewController new]];
}

@end
